home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / SHELLS / SZ2 / GCONVERT.INT < prev    next >
Text File  |  1992-08-31  |  6KB  |  113 lines

  1.    {*******************************************************************
  2.  
  3.    GCONVERT.INT
  4.  
  5.    *******************************************************************}
  6.    {|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  7.  
  8.    DATA
  9.  
  10.    [X] "AutoAdjust" causes input strings to change the default
  11.        date format type to the input format.
  12.    [X] "AutoFill" causes invalid input (string or numeric) to default
  13.        to the current system date.
  14.  
  15.    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
  16. CONST
  17.    DateAutoAdjust            : boolean = TRUE ; { set type from input }
  18.    DateAutoFill              : boolean = TRUE ;
  19.    DateCentury               : boolean = TRUE ;
  20.    {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  21.    DATE CODES
  22.    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
  23.    dtUS                      = 1 ;                      { US mm/dd/yy }
  24.    dtUK                      = 2 ;                    { 2-UK dd.mm.yy }
  25.    dtIntl                    = 3 ;                { 3-Int'l dd-Mmm-yy }
  26.    DateType                  : word = dtIntl ;              { default }
  27.    TimeMode12                = FALSE ;
  28.    TimeMode24                = TRUE ;
  29.    TimeMode                  : boolean = TimeMode12 ;
  30.    {|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  31.    CODE
  32.    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
  33.    {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  34.    BOOLEAN
  35.    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
  36. function BooleanTrueFalse    ( B : boolean ) : string ;
  37. function BooleanYesNo        ( B : boolean ) : string ;
  38. function BooleanOnOff        ( B : boolean ) : string ;
  39.    {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  40.    CONVERT  '0'-->0
  41.    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
  42. function StrToByte           ( S : string ) : byte ;
  43. function StrToInt            ( S : string ) : integer ;
  44. function StrToWord           ( S : string ) : word ;
  45. function StrToLong           ( S : string ) : longint ;
  46. function StrToReal           ( S : string ) : real ;
  47.    {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  48.    CONVERT  0-->'0'
  49.    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
  50. function NumToStr            ( R : real ) : string ;
  51.    {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  52.    DATE
  53.    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
  54. procedure GetDateTime        ( VAR DT : DateTime ) ;
  55. procedure StrToDate          ( S : string ; VAR DT : DateTime ) ;
  56. function DateToStr           ( DT : DateTime ; Format : word ) : string ;
  57. function DateFormat          ( S : string ; Format : word ) : string ;
  58. function IsDateValid         ( DT : DateTime ) : boolean ;
  59. function IsDateStrValid      ( S : string ) : boolean ;
  60. procedure DateForceValid     ( VAR DT : DateTime ) ;
  61. function DayToStr            ( DayOfWeek : word ) : string ;
  62. function ToJulian            ( DT : DateTime ) : longint ;
  63. procedure FromJulian         ( JulianDay : real ; VAR DT : DateTime ) ;
  64. function DaysBetween         ( DT1 , DT2 : DateTime ) : longint ;
  65. function ZellerNum           ( DT : DateTime ) : byte ;
  66. function ZellerJulian        ( R : real ) : byte ;
  67.    {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  68.    TIME
  69.    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
  70. function IsTimeValid         ( DT : DateTime ) : boolean ;
  71. procedure TimeForceValid     ( VAR DT : DateTime ) ;
  72. function TimeToStr           ( DT : DateTime ; Mode24 : boolean ) : string ;
  73. procedure StrToTime          ( S : string ; VAR DT : DateTime ) ;
  74. procedure FromTotalSeconds   ( Seconds : longint ; VAR DT : DateTime ) ;
  75. function ToTotalSeconds      ( DT : DateTime ) : longint ;
  76.    {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  77.    DURATION
  78.    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
  79. function DurationToStr       ( DT : DateTime ) : string ;
  80. function SecondsBetween      ( DT1 , DT2 : DateTime ) : longint ;
  81. procedure GetDuration        ( DT1 , DT2 : DateTime ; VAR Result : DateTime ) ;
  82.    {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  83.    FILE
  84.    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
  85. function GetFileDateTime     ( S : PathStr ; VAR DT : DateTime ) : boolean ;
  86. function SetFileDateTime     ( S : PathStr ; VAR DT : DateTime ) : boolean ;
  87.    {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  88.    REPORT
  89.    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
  90. function Now                 : string ;
  91. function Today               : string ;
  92. function DateAndTimeToStr    ( DT : DateTime ; WhichDateType : word ; Mode24 : boolean ) : string ;
  93. function FileDateStr         ( S : PathStr ; WhichDateType : word ) : string ;
  94. function FileTimeStr         ( S : PathStr ; Mode24 : boolean ) : string ;
  95. function FileDateTimeStr     ( S : PathStr ; WhichDateType : word ; Mode24 : boolean ) : string ;
  96.    {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  97.    COMPARE (-1,0,1  First greater, Equal, Second greater)
  98.    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
  99. function CompareTime         ( DT1 , DT2 : DateTime ) : shortint ;
  100. function CompareDate         ( DT1 , DT2 : DateTime ) : shortint ;
  101. function CompareDateTime     ( DT1 , DT2 : DateTime ) : shortint ;
  102. function CompareFileDateTime ( S1 , S2 : PathStr ) : shortint ;
  103. function CompareMax          ( x , y : real ) : shortint ;
  104. function CompareMin          ( x , y : real ) : shortint ;
  105.    {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  106.    MAX & MIN
  107.    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
  108. function MaxMinReal          ( x , y : real ; Max : boolean ) : real ;
  109. function MaxMinLongint       ( x , y : longint ; Max : boolean ) : longint ;
  110. function MaxMinInteger       ( x , y : integer ; Max : boolean ) : integer ;
  111. function MaxMinWord          ( x , y : word ; Max : boolean ) : word ;
  112. function MaxMinByte          ( x , y : byte ; Max : boolean ) : byte ;
  113.